<?php
	
	class LoginHandler{
		
		private $LoginSession = "LoginHandlerLoggedIn";
		
		public function Login($user, $pass)
		{			
			switch ($user)
			{
				case "andreas":
					switch ($pass) {
						case "larsson":
							$_SESSION[$this->LoginSession] = "loggedin";			
							return true;
							break;
						default:
							return false;
					}
				case "zlatan":
					switch ($pass) {
						case "ibra":
							$_SESSION[$this->LoginSession] = "loggedin";
							return true;
							break;
						default:
							return false;
					}
				case "nisse":
					switch ($pass) {
						case "nissesson":
							$_SESSION[$this->LoginSession] = "loggedin";
							return true;
							break;
						default:
							return false;
					}									
				default:
					return false;
			}
		}
		
		public function Logout()
		{
			if(isset($_SESSION[$this->LoginSession]) == true){
				unset($_SESSION[$this->LoginSession]);
			}
		}
		
		public function IsLoggedIn()
		{
			if(isset($_SESSION[$this->LoginSession]) == true){
				return true;
			}
			return false;
		}
		
	}
